package com.hornsun.domain.constant.error;

/**
 * Created by 编译中... on 2018/8/3.
 */
public enum AuthError {
    AUTH_COUNT_LIMIT(10020,"授权数达到上限"),
    MAX_OFFLINE_DAYS_LIMIT(10021,"最大离线时长超过上限"),
    UNABLE_REPEAT_AUTH(10022,"不能重复授权");

    private Integer code;
    private String content;

    AuthError(Integer code ,String content){this.code=code;this.content=content;}

    public Integer getCode() {
        return code;
    }

    public String getContent() {
        return content;
    }

    public static AuthError authErrorByContent(String content) {
        for (AuthError authError : values()) {
            if (authError.content.equals(content)){
                return authError;
            }
        }
        return null;
    }
}
